﻿<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <title></title>
    <style>
        table
        {
            border: 1px solid #000000;
            cursor: pointer;
        }
        .even
        {
            background: #FFF38F;
        }
        .odd
        {
            background: #FFFFEE;
        }
        .selected
        {
            background: #F00;
        }
        .parent
        {
            background: #a4bdf2;
            text-align: center;
        }
    </style>
    <script src="Scripts/jquery-1.4.1.js" type="text/javascript"></script>
    <script type="text/javascript">
        $(function () {
            $('tbody>tr:even').addClass('even');
            $('tbody>tr:odd').addClass('odd');
            $('tbody>tr').click(function () {
                $(this).addClass('selected').siblings().removeClass('selected'); ;
                $(this).find(':radio').attr('checked', true);
            });
            $('tr.parent').click(function () {
                $(this).toggleClass('selected');
                $('.child_' + $(this).attr('id')).toggle();
            });
        });
    </script>
</head>
<body>
    <form action="#" method="POST" id="regForm">
    <table>
        <thead>
            <tr>
                <th>
                </th>
                <th>
                    姓名
                </th>
                <th>
                    性别
                </th>
                <th>
                    暂住地
                </th>
            </tr>
        </thead>
        <tbody>
            <tr class="parent" id="row_01">
                <td colspan="4">
                    前台设计组
                </td>
            </tr>
            <tr class="child_row_01">
                <td>
                    <input type="radio" name="myRadio" />
                </td>
                <td>
                    张三
                </td>
                <td>
                    男
                </td>
                <td>
                    浙江宁波
                </td>
            </tr>
            <tr class="child_row_01">
                <td>
                    <input type="radio" name="myRadio" />
                </td>
                <td>
                    李四
                </td>
                <td>
                    男
                </td>
                <td>
                    浙江杭州
                </td>
            </tr>
            <tr class="child_row_01">
                <td>
                    <input type="radio" name="myRadio" />
                </td>
                <td>
                    王武
                </td>
                <td>
                    男
                </td>
                <td>
                    湖南长沙
                </td>
            </tr>
            <tr class="parent" id="row_02">
                <td colspan="4">
                    后台开发组
                </td>
            </tr>
            <tr class="child_row_02">
                <td>
                    <input type="radio" name="myRadio" />
                </td>
                <td>
                    马六
                </td>
                <td>
                    男
                </td>
                <td>
                    湖北武汉
                </td>
            </tr>
            <tr class="child_row_02">
                <td>
                    <input type="radio" name="myRadio" />
                </td>
                <td>
                    Rain
                </td>
                <td>
                    男
                </td>
                <td>
                    浙江温州
                </td>
            </tr>
            <tr class="child_row_02">
                <td>
                    <input type="radio" name="myRadio" />
                </td>
                <td>
                    Mary
                </td>
                <td>
                    女
                </td>
                <td>
                    浙江杭州
                </td>
            </tr>
        </tbody>
    </table>
    </form>
</body>
</html>
